﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BaseSet.Data;
using BaseSet.Logic;
using BaseSet.Entity;
using BaseSet.Framework;
using BaseSet.Entity.Common;
using BaseSet.Entity.Common.Text;
using BaseSet;
using System.Data;

namespace WebSite.Ajax
{
    public partial class SendMessage : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string touserid = Request.QueryString["touserid"] + "";
            string messagecontent = Request.QueryString["messagecontent"] + "";

            Users uinfo = UserBase.GetCurrentUser();
            if (uinfo == null)
            {
                Response.Write("-1");
                return;
            }
            else
            {
                Message minfo = new Message();
                MessageHelper mhelper = new MessageHelper();
                minfo.FromUsersID = uinfo.ID;
                minfo.FromNickName = uinfo.NickName;
                minfo.ToUsersID = touserid;
                minfo.Flag = 0;
                minfo.Status = 0;
                minfo.MessageContent = messagecontent;
                mhelper.AddMessage(minfo);
                Response.Write("1");
                return;
            }
        }
    }
}